const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({

  transpileDependencies: true,
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          javascriptEnabled: true  // 关键配置
        }
      },
      postcss: {
        postcssOptions: {
          plugins: [
            require('postcss-rem-to-pixel')({
              rootValue: 19.2,
              propList: ['*'],
              transformUnit: 'px'
            }),
            require('postcss-px-to-viewport')({
              viewportWidth: 1920, // (Number) 设计稿宽度
              viewportHeight: 1080, // (Number) 设计稿高度，可选
              unitPrecision: 5, // (Number) 转换保留小数位数
              viewportUnit: 'vw', // (String) 转换单位
              selectorBlackList: ['.ignore', '.hairlines'], // (Array) 不转换的类名
              minPixelValue: 1, // (Number) 最小转换像素值
              mediaQuery: false // (Boolean) 是否转换媒体查询中的px
            })
          ]
        }
      },
    }
  }
})
